import http from '@/utils/request'
import moment from 'moment'
/**
 *
 * @returns 商品热搜
 */
export const reqHotGoods = () => http.get(`/order-service/report/skuTop/11/${(moment(moment().format('YYYY-MM-DD'))
.subtract(7, 'days')
.format('YYYY-MM-DD'))}/${moment().format('YYYY-MM-DD')}`)
// 销售趋势图

export const reqMarket = () => http.get('/order-service/report/skuCollect/2/2022-11-01')
/**
 * @returns  根据地区汇总销售额数据(销售量分布)
 */
export const reqAreaSell = (data = '2021-10-10') => http.get(`/order-service/report/regionCollect/${data}/${moment().format('YYYY-MM-DD')}`)
/**
 *  销售趋势图 1按照日 2按照月 /api/order-service/report/amountCollect/:collectType/:start/:end
 */
export const reqMarketEXS = (i = moment(moment().format('YYYY-MM-DD'))
  .subtract(365, 'days')
  .format('YYYY-MM-DD')) => http.get(`/order-service/report/amountCollect/1/${i}/${moment().format('YYYY-MM-DD')}`)

// 工单统计
export const reqStatistics = () => http.get(`/task-service/task/taskReportInfo/${moment(moment().format('YYYY-MM-DD')).subtract(20, 'days').format('YYYY-MM-DD')}%2000:00:00/${moment().format('YYYY-MM-DD')}%2023:59:59`)

// 销售统计
export const reqMarket1 = () => http.get(`/order-service/report/orderCount?start=${moment(moment().format('YYYY-MM-DD')).subtract(20, 'days').format('YYYY-MM-DD+HH:mm:ss')}&end=${moment().format('YYYY-MM-DD+HH:mm:ss')}`)

export const reqMarket2 = () => http.get(`/order-service/report/orderAmount?start=${moment(moment().format('YYYY-MM-DD')).subtract(20, 'days').format('YYYY-MM-DD+HH:mm:ss')}&end=${moment().format('YYYY-MM-DD+HH:mm:ss')}`)
// 合作商点位数Top5
export const reqMarketPie = () => http.get('/vm-service/node/nodeCollect')
// 点为数

export const reqNumberOfpoints = () => http.get('/vm-service/node/count')

// 合作商家

// export const CooperativeMerchants = () => http.get('/user-ervice/partner/count')
export const CooperativeMerchants = () => http.get('/user-service/partner/count')
